class DanhMuc
  include MongoMapper::Document
  
  key     :loai_danh_muc,     String,   :presence => true,    :length => {:minimum => 4}
  key     :slug,              String,   :presence => true,    :length => {:minimum => 4}
  
  many :danh_muc_ngon_ngus
  many :bai_viets
  many :san_phams
end

class DanhMucNgonNgu
  include MongoMapper::EmbeddedDocument
  
  key     :ngon_ngu,          String,   :presence => true,    :length => {:minimum => 2}   
  key     :ten,               String,   :presence => true,    :length => {:minimum => 4}
end
